/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package terminal.model;

import terminal.interfaces.ISerialConfiguration;
import jssc.SerialPortList;

/**
 *
 * @author wro00113
 */
public class SerialConfiguration implements ISerialConfiguration
{
    public SerialConfiguration()
    {
        m_enumeratedPorts = SerialPortList.getPortNames();
        m_baudRates = new String[ 5 ];                
        m_parity = new String[ 3 ];
        m_stopBits = new String[ 3 ];
               
        m_baudRates[ 0 ] = "115200";
        m_baudRates[ 1 ] = "57600";
        m_baudRates[ 2 ] = "38400";
        m_baudRates[ 3 ] = "19200";
        m_baudRates[ 4 ] = "9600";
        
        m_parity[ 0 ] = "None";
        m_parity[ 1 ] = "Even";
        m_parity[ 2 ] = "Odd";
        
        m_stopBits[ 0 ] = "1";
        m_stopBits[ 1 ] = "1.5";
        m_stopBits[ 2 ] = "2";                        
    }
    
    @Override public String[] getEnumeratedPorts()
    {
        return m_enumeratedPorts;
    }
    
    @Override public String[] getBaudRates()
    {
        return m_baudRates;
    }
    
    @Override public String[] getParity()
    {
        return m_parity;
    }
    
    @Override public String[] getStopBits()
    {
        return m_stopBits;
    }
        
    private String[] m_enumeratedPorts;
    private String[] m_baudRates;
    private String[] m_parity;
    private String[] m_stopBits;
}
